from page.course_org_page import CourseOrgPage
from handle.course_org_handle import CourseOrgHandle
from time import sleep

class CourseOrgBusicess():
    def __init__(self, driver):
        self.co_p = CourseOrgPage(driver)
        self.co_h = CourseOrgHandle(driver)

    def add_form(self, name, desc, tag, num, image_name, text):
        self.co_h.click_add()
        sleep(5)
        """填写"""
        self.co_h.send_name(name)
        self.co_h.send_desc(desc)
        self.co_h.send_tag(tag)
        self.co_h.click_category()
        self.co_h.send_click_num(num)
        self.co_h.send_fav_num(num)
        self.co_h.send_image(image_name)
        self.co_h.send_address(text)
        self.co_h.click_city()
        self.co_h.send_student(num)
        self.co_h.send_course(num)
        """保存"""
        self.co_h.click_save()
        sleep(5)
        text = self.co_p.get_add_tishi_element().text
        return text
